package com.aholu.model;

import java.util.Date;
import java.util.List;

import org.hibernate.Session;

import com.aholu.dao.DaoFactory;
import com.aholu.dao.GenericDaoImpl;
import com.aholu.dao.UserDao;
import com.aholu.hibernate.HibernateUtil;

public class Deneme {

	public static void main(String[] args) {

		UserDao dao = new UserDao();

		Session session = HibernateUtil.getSessionFactory().openSession();
		session.beginTransaction();

		User user = new User();
		user.setUserName("aholu");
		user.setName("Hasan");
		user.setDate(new Date());
		user.setSurName("ali");
		user.setEmail("sad@gfdgdf.com");
		user.setPassword("aA1-11");
		user.setRole("admin");
		session.save(user);

		User user2 = new User();
		user2.setUserName("aholu1");
		user2.setName("Hasan");
		user2.setDate(new Date());
		user2.setSurName("asd");
		user2.setEmail("sads@gfdgdf.com");
		user2.setPassword("aA1-11");
		user2.setRole("standart");
		session.save(user2);

		session.getTransaction().commit();

	}

}
